/**
 * Bank Model
 */
package cn.tonyqiu.wonuly.model;

/**
 * @author <a href="mailto:tony.qiu.smart@gmail.com">Tony Qiu</a>
 * 
 */
public class Bank extends BaseObject {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4876221268129283409L;
	private Integer id;
	private String name;
	private String website;

	/**
	 * @return the id
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the website
	 */
	public String getWebsite() {
		return website;
	}

	/**
	 * @param website
	 *            the website to set
	 */
	public void setWebsite(String website) {
		this.website = website;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.tonyqiu.wonuly.model.BaseObject#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (!(o instanceof Bank)) {
			return false;
		}
		final Bank b = (Bank) o;
		if (b.getId() != null && b.getId().intValue() == id.intValue()) {
			return true;
		}
		return false;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.tonyqiu.wonuly.model.BaseObject#hashCode()
	 */
	@Override
	public int hashCode() {
		return id != null ? id.intValue() : 0;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see cn.tonyqiu.wonuly.model.BaseObject#toString()
	 */
	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("id=" + id).append(":name=" + name).append(
				":website=" + website);
		return sb.toString();
	}

}
